from sqlalchemy import Integer, Column, DECIMAL, String

from app.models.base import BaseModel


class SkuInfoDo(BaseModel):
    __tablename__ = "goods_sku"
    __table_args__ = {"comment": "SKU信息"}

    sku_id = Column(Integer, primary_key=True, autoincrement=True, comment='SKU ID')
    goods_id = Column(Integer, nullable=True, index=True, comment='SPU ID')
    sku_name = Column(String(255), nullable=True, comment='SKU名称')
    catalog_id = Column(Integer, nullable=True, comment='所属分类ID')
    brand_id = Column(Integer, nullable=True, comment='品牌ID')
    sku_image_id = Column(String(255), nullable=True, comment='默认图片')
    sku_title = Column(String(255), nullable=True, comment='标题')
    sku_subtitle = Column(String(2000), nullable=True, comment='副标题')
    price = Column(DECIMAL(10, 2), nullable=True, comment='价格')
    sale_count = Column(Integer, nullable=True, comment='销量')

